<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            background: cornsilk;
        }
        #container{
            width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;

        }
        .header {
            height: 161px;
            width: 100%;
            /* line-height: 161px; */
            background-color: #fff;
            font-size: 18px;
        }

        .header .left {
            margin-top: 43px;
            flex-wrap: wrap;
            display: flex;
            width: 400px;
        }
        .header .centre{
            width: 400px;
        }
        .header .centre input{
            margin-top: 43px;
            width: 380px;
            height: 42px;
            text-indent: 10px;
            border-radius: 42px;
            position: absolute;
        }
        .header .centre button{
            width: 100px;
            height: 40px;
            border-radius: 40px;
            background: rgb(250, 250, 3);
            position: relative;
            top: 46px;
            left: 280px;
            border: 0px solid #000;
        }
        .header .right{
            width: 400px;
        }
        .header p {
            font-size: 11px;
        }

        .header img {
            width: 75px;
            height: 75px;
            margin-right: 20px;
        }

        .tatol {
            display: flex;
            justify-content: space-around;
            flex-wrap: wrap;
            width: 1200px;
            margin: 50px auto;
        }

        .tatol .product {
            background: white;
            width: 276px;
            margin-bottom: 40px;
        }

        .word {
            color: red;
            font-size: 17px;
            margin-top: 20px;
        }

        .title {
            font-size: 15px;
            margin-top: 15px;
        }

        .tatol .product:hover {
            box-shadow: 5px 5px 5px 5px white;
        }
    </style>
</head>

<body>
    <div class="header">
        <div id="container">
            <div class="left">
                <img src=""
                    alt="">
                <div>
                    <h1>熊猫优选</h1>
                    <p>XIONG MAO YOU XUAN</p>
                </div>
            </div>
            <div class="centre">
                <input type="text" placeholder="搜索商品，发现更多优惠">
                <button>搜索</button>
            </div>
            <div class="right">

            </div>
        </div>
    </div>
    <div class="tatol">

    </div>
    <script src="../jquery-3.6.0.js"></script>
    <script>
        function list() {
            $.ajax({
                url: 'https://www.xiongmaoyouxuan.com/api/tab/1/feeds?start=20',
                type: 'get',
                success: function (data) {
                    // console.log(data);
                    showList(data.data.list)
                },
                error: function (error) {
                    console.log(error);
                }
            })
        }

        function showList(item) {
            let m = ``
            for (let i = 0; i < item.length; i++) {
                m += `<div class="product" onclick='move(${item[i].id})'>
            <img src=${item[i].image} width='276px'>
            <div class='title'>${item[i].title}</div>
            <div class="word">￥${item[i].originPrice}</div>
        </div>
            `
            }

            $('.tatol').html(m)

        }

        function move(id) {
            location.href = `file:///E:/H5%E4%BB%A3%E7%A0%81/12.30/%E8%AF%A6%E6%83%85%E9%A1%B5.html?id=${id}`
        }
        list()
    </script>
</body>

</html>